package com.czf.easyexcel.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ColumnWidth(20)
public class Teacher {
    @ExcelProperty
    private String teacher_name;
    @ExcelProperty
    private Integer age;
    @ExcelProperty
    private String department;
    // 循环生成10个学生对象
    public static List<Teacher> TeacherInitData() {
        ArrayList<Teacher> teachers = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            Teacher teacher = new Teacher();
            teacher.setAge(i);
            teacher.setDepartment("信息工程学院"+i);
            teacher.setTeacher_name("老师"+i);
            teachers.add(teacher);
        }
        return teachers;
    }
}
